package cn.stylefeng.guns.sys.modular.dbServicelist.mapper;

import cn.stylefeng.guns.sys.modular.dbServicelist.entity.DbServicelist;
import cn.stylefeng.guns.sys.modular.dbServicelist.entity.Exchange;
import cn.stylefeng.guns.sys.modular.dbServicelist.model.params.DbServicelistParam;
import cn.stylefeng.guns.sys.modular.dbServicelist.model.result.DbServicelistResult;
import cn.stylefeng.guns.sys.modular.dbservicedetails.entity.TableDetails;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 目录服务  Mapper 接口
 * </p>
 *
 * @author zhaoyiheng
 * @since 2020-08-19
 */
public interface DbServicelistMapper extends BaseMapper<DbServicelist> {

    /**
     * 获取列表
     *
     * @author zhaoyiheng
     * @Date 2020-08-19
     */
    List<DbServicelistResult> customList(@Param("paramCondition") DbServicelistParam paramCondition);

    /**
     * 获取map列表
     *
     * @author zhaoyiheng
     * @Date 2020-08-19
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") DbServicelistParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author zhaoyiheng
     * @Date 2020-08-19
     */
    Page<DbServicelistResult> customPageList(@Param("page") Page page, @Param("paramCondition") DbServicelistParam paramCondition);


    /**
     * 获取分页过期实体列表
     *
     * @author zhaoyiheng
     * @Date 2020-08-19
     */
    Page<DbServicelistResult> customPageListTime(@Param("page") Page page, @Param("paramCondition") DbServicelistParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author zhaoyiheng
     * @Date 2020-08-19
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") DbServicelistParam paramCondition);

    void quxiaoquanxian(@Param("tableName") String tableName, @Param("user") String user, @Param("password") String password);

    void shuaxin();

    Integer findDatabase(@Param("tableName") String tableName);

    Integer findUser(@Param("user") String user);

    void delDatabase(@Param("tableName") String tableName);

    void delUser(@Param("user") String user);

    void editPassword(@Param("user") String user, @Param("password") String password);

    /**
     * 获取分页实体列表
     *
     * @author zhaoyiheng
     * @Date 2020-08-19
     */
    Page<DbServicelistResult> customPageServiceList(@Param("page") Page page, @Param("paramCondition") DbServicelistParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author author
     * @Date 2020-09-10
     */
    Page<DbServicelistResult> queryApplyList(@Param("page") Page page, @Param("paramCondition") DbServicelistParam paramCondition);

    /**
     * 查询服务器列表
     */
    List<Exchange> queryExchangeListInfo(@Param("paramCondition") Exchange paramCondition);

    /**
     * 通过id查询某条serviceList
     */
    DbServicelistResult queryDbServiceListById(@Param("id") Integer id);

    /**
     * 普通的查询servicelist的方法
     */
    Page<DbServicelistResult> queryServiceList(@Param("page") Page page, @Param("paramCondition") DbServicelistParam paramCondition);


    /**
     * 重新注册方法
     */
    int reApply(@Param("paramCondition") DbServicelistParam paramCondition);


}
